package com.hcycom.hcywbsocket.controller;

import com.hcycom.hcywbsocket.model.InMessage;
import com.hcycom.hcywbsocket.service.AlarmInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.messaging.handler.annotation.MessageMapping;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Controller;

/**
 * @Auther: CYL
 * @Date: 2018/6/7 10:38
 * @Description:
 */
@Controller
public class AlarmInfoController {

    @Autowired
    AlarmInfoService alarmInfoService;


    @MessageMapping("alarm/info")
    @Scheduled(fixedRate = 3000)  //方法不能加参数
    public void singleChat() {

        alarmInfoService.sendAlarmInfo();


    }
}
